package lwk.function;

import java.util.function.Consumer;

/**
 * @author:lwk
 * @create: 2022-08-18 22:20
 * @Description: Consumer消费型接口:只有输入，没有返回值
 */
public class Demo03 {
    public static void main(String[] args) {

//        Consumer<String> consumer = new Consumer<>() {
//            @Override
//            public void accept(String s) {
//                System.out.println(s);
//            }
//        };

//        Consumer<String> consumer = s -> System.out.println(s);
        Consumer<String> consumer = System.out::println;

        consumer.accept("accept test");
    }
}
